home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
FromTheMag
/
JW FLV MEDIA PLAYER 4.2
/
mediaplayer.exe
/
player.swf
/
scripts
/
com
/
jeroenwijering
/
player
/
Player.as
< prev
next >
Wrap
Text File
|
2008-11-04
|
4KB
|
130 lines
package com.jeroenwijering.player
{
import com.jeroenwijering.events.PlayerEvent;
import com.jeroenwijering.events.SPLoaderEvent;
import com.jeroenwijering.plugins.Controlbar;
import com.jeroenwijering.plugins.Display;
import com.jeroenwijering.plugins.Playlist;
import com.jeroenwijering.plugins.Rightclick;
import com.jeroenwijering.utils.Configger;
import flash.display.MovieClip;
import flash.events.Event;
public class Player extends MovieClip
{
protected var loader:SPLoader;
protected var model:Model;
public var config:Object;
public var skin:MovieClip;
public var view:View;
protected var controller:Controller;
protected var configger:Configger;
public var player:MovieClip;
public function Player()
{
config = {
"author":undefined,
"description":undefined,
"date":undefined,
"duration":0,
"file":undefined,
"image":undefined,
"link":undefined,
"start":0,
"tags":undefined,
"title":undefined,
"type":undefined,
"backcolor":undefined,
"frontcolor":undefined,
"lightcolor":undefined,
"screencolor":undefined,
"controlbar":"bottom",
"controlbarsize":20,
"height":300,
"playlist":"none",
"playlistsize":180,
"skin":undefined,
"width":400,
"autostart":false,
"bufferlength":1,
"displayclick":"play",
"icons":true,
"item":0,
"logo":undefined,
"mute":false,
"quality":true,
"repeat":"none",
"resizing":true,
"shuffle":false,
"state":"IDLE",
"stretching":"uniform",
"volume":90,
"abouttext":undefined,
"aboutlink":"http://www.jeroenwijering.com/?item=JW_FLV_Player",
"client":undefined,
"id":undefined,
"linktarget":"_blank",
"plugins":undefined,
"streamer":undefined,
"token":undefined,
"tracecall":undefined,
"version":"4.2.95"
};
super();
visible = false;
skin = this["player"];
addEventListener(Event.ADDED_TO_STAGE,loadConfig);
}
protected function startPlayer(param1:SPLoaderEvent = null) : *
{
loader.removeEventListener(SPLoaderEvent.PLUGINS,startPlayer);
dispatchEvent(new PlayerEvent(PlayerEvent.READY));
visible = true;
}
protected function loadMVC(param1:SPLoaderEvent = null) : void
{
controller = new Controller(config,skin);
model = new Model(config,skin,controller);
view = new View(config,skin,controller,model,loader);
controller.start(model,view);
loadPlugins();
}
protected function loadSkin(param1:Event = null) : void
{
loader = new SPLoader(this);
loader.addEventListener(SPLoaderEvent.SKIN,loadMVC);
loader.loadSkin(config["skin"]);
}
protected function loadConfig(param1:Event = null) : void
{
configger = new Configger(this);
configger.addEventListener(Event.COMPLETE,loadSkin);
configger.load(config);
}
protected function loadPlugins() : void
{
new Rightclick().initializePlugin(view);
new Display().initializePlugin(view);
new Playlist().initializePlugin(view);
loader.addEventListener(SPLoaderEvent.PLUGINS,startPlayer);
loader.loadPlugins(config["plugins"]);
new Controlbar().initializePlugin(view);
}
}
}